<?php
namespace app\api\controller\v1;
use app\api\validate\IDCllection;
use \app\api\model\Theme as ThemeModel;
use app\api\validate\IDIntValidate;
use app\lib\exception\ThemeException;

class Theme
{
    /*
     * 通过指定$id 获取 theme表 数据
     * @http GET
     * @url /theme?ids=id1,id2,id3
     * return 一组theme 模型
     */
    public function getSimpleList($ids=[]){
        (new IDCllection())->goCheck();
        $ids = explode(',',$ids);
        $result = ThemeModel::getTheme($ids);
        if(!is_array($result)){
            throw new ThemeException();
        }
        return $result;
    }
    public function getCmp($id){
        (new IDIntValidate())->goCheck();
     $result =   ThemeModel::getCmp($id);
     return $result;
    }



}
